*** creating lifetime means from yearly data
* load the yearly jackknifes
use "/Users/gholliba/Dropbox/Projects/Ramey-Klingler-Hollibaugh Personality/Data/Personality Estimates/Revised Yearly Estimates/BootstrapHouseJackknife.dta"

* drop the irrelevant data (CIs)
keep icpsr Openn Consc Extra Agree Emoti

* generate lifetime means by icpsr no.
sort icpsr
by icpsr: egen lifeOpen=mean(Openn)
by icpsr: egen lifeConsc=mean(Consc)
by icpsr: egen lifeExtra=mean(Extra)
by icpsr: egen lifeAgree=mean(Agree)
by icpsr: egen lifeEmoti=mean(Emoti)

* keep only one observation per icpsr
bysort icpsr : gen seq=_n
keep if seq==1

* drop the other variables to avoid future confusion
drop seq Openn Consc Extra Agree Emoti

* resort just to be safe
sort icpsr

* save file as stata 12 file
saveold "/Users/gholliba/Dropbox/Projects/Ramey-Klingler-Hollibaugh Personality/Data/Personality Estimates/Revised Yearly Estimates/LifetimeMeansHouse.dta", version(12) replace
